<html>
<meta http-equiv="Content-type"content="text/http;charset=utf-8"/>
<style type="text/css">
.classTable
{
background: -webkit-linear-gradient(#EEEEEE, #BBBBBB);
}
#nut
{
background:-webkit-linear-gradient(#6666FF, #0099CC);
border : 0px;
-webkit-border-radius:4px;
color:white;
}
#nut:hover
{
background:-webkit-linear-gradient(#0099CC, #0066CC);
}
#nut:active
{
position:relative;
top:1.2px;
left:0.5px;	
}
.classTxt
{
background-color:#828282;
color:#E8E8E8;
}
</style>
<body>
<?php
if(isset($_POST["chuoi"]) && isset($_POST["old"]) && isset($_POST["new"]))
{
	$chuoi = $_POST["chuoi"];
	$old = $_POST["old"];
	$new = $_POST["new"];
	$ketqua = str_replace($old, $new, $chuoi);
}
?>
<form id="form1"name="form1"method="post"action="ThayTheChuoi.php">

<table class="classTable"align="center"border="1.5px">
<tr>
	<td colspan="2">THAY THẾ TỪ TRONG CHUỖI</td>
</tr>
<tr>
	<td>chuỗi: </td>
	<td><label><input name="chuoi"id="chuoi"class="classTxt"type="text"value="<?php
	if(isset($_POST["chuoi"]))
	{
		echo $_POST["chuoi"];
	}
	?>"/></label></td>

</tr>
<tr>
	<td>từ gốc: </td>
	<td><label><input class="classTxt"name="old"id="old"type="text"value="<?php
	if(isset($_POST["old"]))
	{
		echo $_POST["old"];
	}
	?>"/></label></td>

</tr>
<tr>
	<td>từ thay thế: </td>
	<td><label><input class="classTxt"name="new"id="new"type="text"value="<?php
	if(isset($_POST["new"]))
	{
		echo $_POST["new"];
	}
	?>"/></label></td>

</tr>
<tr>
	<td colspan="2"align="center"><label><input id="nut"name="nut"type="submit"value="Thay Thế"/></label></td>
</tr>
<tr>
<td colspan="2"><label><input style="background-color:#363636;width:220px;"readonly="true"class="classTxt"id="ketqua"name="ketqua"type="text"value="<?php
echo $ketqua;
?>"/></label></td>
</tr>
</table>
</form>
</body>
<html>